import {mapState} from 'vuex';

export default {

  computed: {
    ...mapState(['userModule'])
  },

  data() {
    return {
      leftJson: []
    }
  },
  render(createElement) {
    // render函数，用于动态创建子组件
    let roles = [];
    for (let i in this.userModule.roleList) {
      roles.push(this.userModule.roleList[i]);
    }

    console.log(this.templates)
    console.log(roles)
    for (let name in this.templates) {
      for (let i in roles) {
        if (roles[i] == name) {
          return createElement(this.templates[name]);
        }
      }
    }


    //return h('no-authority');
  }
}
